package com.vegetable.modules.service.inbound;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.vegetable.common.utils.PageUtils;
import com.vegetable.common.utils.R;
import com.vegetable.modules.entity.baseData.AccountDetails;
import com.vegetable.modules.entity.finance.po.PackCanPayPO;
import com.vegetable.modules.entity.inbound.PackDelivery;
import com.vegetable.modules.entity.inbound.PackDeliveryTeam;
import com.vegetable.modules.entity.inbound.po.PackDeliverySequencePO;
import com.vegetable.modules.entity.inbound.vo.PackDeliverySequenceVO;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 加工打包 服务类
 * </p>
 *
 * @author wangruijie
 * @since 2024-03-21
 */
public interface IPackDeliveryService extends IService<PackDelivery> {

    /**
     * 加工打包列表查询
     * @param params
     * @return
     */
    PageUtils queryPage(Map<String, Object> params);

    /**
     * 详情加工打包
     * @param id null
     * @return R
     * @author wrj
     * @since 2024/3/21 下午4:35
     */
    R detailPackDelivery(Long id);

    /**
     * 新增、修改加工打包
     * @param packDelivery null
     * @return R
     * @author wrj
     * @since 2024/3/21 下午4:35
     */
    R saveOrEdit(PackDelivery packDelivery) throws Exception;

    /**
     * 提交加工打包
     * @param packDelivery null
     * @return R
     * @author wrj
     * @since 2024/3/21 下午4:35
     */
    R submitPackDelivery(PackDelivery packDelivery) throws Exception;

    /**
     * 删除加工打包
     * @param id null
     * @return R
     * @author wrj
     * @since 2024/3/21 下午4:35
     */
    R deletePackDelivery(Long id) throws Exception;

    List<PackDelivery> selectByIds(List<Long> orderIds);

    List<PackDelivery> selectByDocNoList(List<String> docNoList);

    R lastOrder(Long id);

    IPage<PackDeliverySequenceVO> statisticsPackDelivery(PackDeliverySequencePO po);

    void checkOrderCostByStockId(Long stockId);

    /**
     * 分配
     * @param po
     * @return
     */
    int allocateTeams(List<PackDeliveryTeam> po);

    List<AccountDetails> canPaymentList(PackCanPayPO po);
}
